﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DataAccess;

namespace Hazop
{
    public partial class GuideWordConfigForm : Form
    {
        public GuideWordConfigForm()
        {
            InitializeComponent();
            _bindGuideWord.DataSource = Program.Workspace.GuideWordList;
            _lbxGuideWord.DataSource = _bindGuideWord;
        }

        private void _btnAddNew_Click(object sender, EventArgs e)
        {
            AddNewGuideWordForm newWordForm = new AddNewGuideWordForm();
            newWordForm.ShowDialog();
            if (newWordForm.DialogResult == DialogResult.OK)
            {
                _bindGuideWord.Insert(_bindGuideWord.Count,newWordForm.TbxGuideWord.Text);
            }
        }

        private int GetCount() {
            return _bindGuideWord.Count;
        }
       
    }
}
